package com.pet.server.test;

import java.util.HashMap;
import java.util.Map;

import com.pet.server.ext.ApiError;
import com.pet.server.ext.Result;
import com.pet.server.ext.action.home.Index;
import com.pet.server.ext.util.HttpClientUtils;
import com.pet.server.ext.util.Parameters;

public class DoMain {

	public static void main(String[] args){
		try {
			index();
		} catch (ApiError e) {
			e.printStackTrace();
		}
		tes();
	}
	
	public static void index() throws ApiError{
		Parameters p = new Parameters();
		Index index = new Index();
		index.parseToParameter(p);
		Result r=  index.invokeService();
		System.out.println(r.getResponseString());
		
		
	}
	
	public static void tes(){
		String url = "http://adman.zplay.cn/together/app/add";
		Map<String, String> map = new HashMap<String,String>();
		
		String str = HttpClientUtils.postFromUrl(url, map);
		System.out.println(str);
	}
}
